<style>
    #dataDictionary-add {
        padding: 20px 25px 25px 0;
    }

    #dataDictionary-add .layui-form-label {
        width: 88px;
    }

    #dataDictionary-add .layui-input-block {
        margin-left: 120px;
    }
</style>
<div class="layui-fluid" id="dataDictionary-add">
    <form class="layui-form" action="" lay-filter="dataDictionary-add-form">
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">数据字典条目内容：</label>
            <div class="layui-input-block">
                <input type="text" name="content" maxlength="20" lay-verify="range|required"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item febs-hide">
            <button class="layui-btn" lay-submit="" lay-filter="dataDictionary-add-form-submit" id="submit"></button>
            <button type="reset" class="layui-btn" id="reset"></button>
        </div>
    </form>
</div>

<script>
    layui.use(['jquery', 'febs', 'form', 'validate'], function () {
        var $ = layui.jquery,
            febs = layui.febs,
            form = layui.form,
            $view = $('#dataDictionary-add'),
            validate = layui.validate;

        form.verify(validate);
        form.render();

        form.on('submit(dataDictionary-add-form-submit)', function (data) {
            febs.post(ctx + 'dataDictionary', data.field, function () {
                layer.closeAll();
                febs.alert.success('新增数据字典条目成功');
                $('#febs-dataDictionary').find('#query').click();
            });
            return false;
        });

    });
</script>